/**
 * Copyright [2019] [LiBo/Alex of copyright liboware@gmail.com ]
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hyts.pinyin.factory;

import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;

/**
 * @project-name:coffice-toolbox
 * @package-name:com.hyts.pinyin.factory
 * @author:LiBo/Alex
 * @create-date:2019-08-05 16:32
 * @copyright:libo-alex4java
 * @email:liboware@gmail.com
 * @description:
 */
public class ChineseCharacterFactory {

    /**
     * 创建小写字母
     * @return
     */
    public static HanyuPinyinOutputFormat createLowerCase(){
        //操作汉语拼音的输出格式解析器
        HanyuPinyinOutputFormat hanyuPinyinOutputFormat = new HanyuPinyinOutputFormat();
        hanyuPinyinOutputFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);
        hanyuPinyinOutputFormat.setToneType(HanyuPinyinToneType.WITH_TONE_NUMBER);
        hanyuPinyinOutputFormat.setVCharType(HanyuPinyinVCharType.WITH_U_UNICODE);
        return hanyuPinyinOutputFormat;
    }

    /**
     * 创建大写字母
     * @return
     */
    public static HanyuPinyinOutputFormat createUpperCase(){
        //操作汉语拼音的输出格式解析器
        HanyuPinyinOutputFormat hanyuPinyinOutputFormat = new HanyuPinyinOutputFormat();
        hanyuPinyinOutputFormat.setCaseType(HanyuPinyinCaseType.UPPERCASE);
        hanyuPinyinOutputFormat.setToneType(HanyuPinyinToneType.WITH_TONE_NUMBER);
        hanyuPinyinOutputFormat.setVCharType(HanyuPinyinVCharType.WITH_U_UNICODE);
        return hanyuPinyinOutputFormat;
    }

    /**
     * 创建大写字母
     * @return
     */
    public static HanyuPinyinOutputFormat create(HanyuPinyinCaseType caseType,HanyuPinyinToneType hanyuPinyinToneType,
                                                            HanyuPinyinVCharType hanyuPinyinVCharType){
        //操作汉语拼音的输出格式解析器
        HanyuPinyinOutputFormat hanyuPinyinOutputFormat = new HanyuPinyinOutputFormat();
        hanyuPinyinOutputFormat.setCaseType(caseType);
        hanyuPinyinOutputFormat.setToneType(hanyuPinyinToneType);
        hanyuPinyinOutputFormat.setVCharType(hanyuPinyinVCharType);
        return hanyuPinyinOutputFormat;
    }
}
